<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<!--[if IE 7]>
  <html class="ie7 lt-ie10">
  <![endif]-->
<!--[if IE 8]>
    <html class="ie8 lt-ie10">
    <![endif]-->
<!--[if IE 9]>
      <html class="ie9 lt-ie10">
      <![endif]-->
<!--[if gt IE 9]>
        <!-->
<html>
<!--<![endif]-->

<head>
<meta charset="utf-8" />
<title>阿猫来了的设置_美丽说</title>
<base href="<%=basePath%>">
<meta name="description"
	content="美丽说, 只做正确流行款. 独家冠名《奔跑吧兄弟》! 平台聚集强大的资深时尚买手团队, 每日推出正确新款, 传授最权威的穿衣经验, 全方位解读搭配技巧, 打造当季最前沿的正确流行款!" />
<meta name="keywords" content="美丽说,higo,衣服,鞋子,包包,配饰,家居,美妆,搭配,团购,美丽说higo" />
<link rel="dns-prefetch" href="http://s.meilishuo.net/">
<link rel="dns-prefetch" href="http://i.meilishuo.net/">
<link rel="dns-prefetch" href="http://d01.res.meilishuo.net/">
<link rel="dns-prefetch" href="http://d02.res.meilishuo.net/">
<link rel="dns-prefetch" href="http://d03.res.meilishuo.net/">
<link rel="dns-prefetch" href="http://d04.res.meilishuo.net/">
<link rel="dns-prefetch" href="http://d05.res.meilishuo.net/">
<meta http-equiv="x-ua-compatible" content="IE=edge,chrome=1" />
<link rel="stylesheet" type="text/css"
	href="pc/css/base.css?1607171729.25" />
<link rel="icon"
	href="pic/_o/75/6e/2f6871f198c0bd7615ffbf9a2f5f_49_48.c5.png"
	type="image/x-icon" />
<link rel="stylesheet" type="text/css"
	href="pc/css/page/account/common.css?1607171729.25" />
<link rel="stylesheet" type="text/css"
	href="pc/css/page/account/datepicker.css?1607171729.25" />
<link rel="stylesheet" type="text/css"
	href="pc/css/page/account/setPersonal.css?1607171729.25" />
<script type="text/javascript" src="pc/jsmin/fml.js?1"></script>
<link rel="stylesheet" type="text/css"
	href="admin/css/layui.css" />
	<link rel="stylesheet" href="admin/css/style.css"/>
	<link href="admin/assets/css/codemirror.css" rel="stylesheet">
    <link rel="stylesheet" href="admin/assets/css/ace.min.css" />
    <link rel="stylesheet" href="admin/assets/css/font-awesome.min.css" /> 
<script type="text/javascript" src="admin/js/layui.js"></script>
</head>

<body>
	<jsp:include page="common/header.jsp"></jsp:include>
	<div class="settings">
		<jsp:include page="common/userleft.jsp"></jsp:include>
		<div class="settings_box">
			<strong class="settings_title">我的信息</strong>
			<fieldset class="setPersonal">
				<form id="setPersonForm">
					<div class="form-list">
						<label class="account-label">注册邮箱</label> <input
							id="register_mail" name="useremail" autocomplete="off"
							class="l_ipt input_disable" type="text" value="${user.useremail }"
							disabled="disabled" /> <strong></strong>
					</div>
					<div class="form-list">
						<label class="account-label">真实姓名</label> <input id="true_name"
							name="truename" autocomplete="off" class="l_ipt" type="text"
							value="${user.truename }" /> <strong></strong>
					</div>
					<div class="form-list">
						<label class="account-label">账户余额</label> <input id="true_name"
							name="usermoney" autocomplete="off" class="l_ipt" type="text"
							value="${user.usermoney==null?0:user.usermoney }" disabled="disabled" /> <strong></strong>
							<!-- <button style="display:inline;" id="member_add" class="layui-btn layui-btn-normal layui-btn-radius">充值</button> -->
							<a href="javascript:ovid()" id="member_add" class="btn btn-warning"><i class="icon-plus"></i>充值</a>
					</div>
					<div class="form-list">
						<label class="account-label">所获积分</label> <input id="true_name"
							name="userscore" autocomplete="off" class="l_ipt" type="text"
							value="${user.userscore }" disabled="disabled" /> <strong></strong>
					</div>
					<div class="form-list">
						<label class="account-label">昵称</label> <input id="nickname"
							name="nickname" autocomplete="off" class="l_ipt" type="text"
							value="${user.nickname }" /> <strong></strong>
					</div>
					<div class="gender" id="gender">
						<label class="account-label">性别</label> <input
							id="female" name="usersex" type="radio" <c:if test="${user.usersex==1 }">checked="checked"</c:if> value="1" class="regular-radio" /> <label
							for="female" class="regular-radio-label"></label> <span>女</span>
						<input name="usersex" id="male" <c:if test="${user.usersex==0 }">checked="checked"</c:if> type="radio" value="0"
							class="regular-radio" /> <label class="regular-radio-label"
							for="male"></label> <span>男</span> <strong></strong>
					</div>
					<!--[if IE 8]>
                    <div class="gender">
                      <label class="account-label">性别</label>
                      <input name="gender" style="margin-top:7px" id="female" type="radio" value="2" />
                      <lable for="female">女</lable>
                      <input name="gender" id="male" type="radio" value="1" />
                      <lable for="male">男</lable></div>
                  <![endif]-->
					<input type="button" onclick="updUserInfo();" value="确 认" id="submit" class="ext_submit" />
					<span class="submitError"></span>
				</form>
			</fieldset>
		</div>
	</div>
	<!--充值金额图层-->
<div class="add_menber" id="add_menber_style" style="display:none">
    <ul class=" page-content">
     <li style="margin:0px 20%;"><input id="money" value="" name="金额" type="text"  class="text_add"/></span><div class="prompt r_f"></div></li>
     </span>
    </ul>
    <input type="hidden" id="userMoney" value="${user.usermoney==null?0:user.usermoney }"/>
 </div>
	<script type="text/javascript">
		function updUserInfo(){
			$.ajax({
		        cache:true,
		        type: "POST",
		        url:'/users/updUserInfo',
		        data:$('#setPersonForm').serialize(),// 你的formid
		        async: false,
		        dataType:"json",
		        error: function(request) {
		            alert("Connection error");
		        },
		        success:function(data) {
		        	if(data){
		        		layer.msg('保存成功！',{icon:1,time:1500});
		        		setTimeout(function(){//两秒后跳转  
		                   location.reload();
		                },1500);
		        	}else{
		        		layer.msg('保存失败，请确认密码是否输入正确后再试！',{icon:2,time:1500});
		        	}
		        }
		    });
		}
	</script>
	<script type="text/javascript">
	/*用户-添加*/
	 $('#member_add').on('click', function(){
	    layer.open({
	        type: 1,
	        title: '请输入充值金额',
			maxmin: true, 
			shadeClose: true, //点击遮罩关闭层
	        area : ['400px' , ''],
	        content:$('#add_menber_style'),
			btn:['充值','取消'],
			yes:function(index,layero){	
			 var num=0;
			 var str="";
			 var reg=/^[0-9]*$/;
	     $(".add_menber input[type$='text']").each(function(n){
	          if($(this).val()=="")
	          {
				   layer.alert(str+=""+$(this).attr("name")+"不能为空！\r\n",{
	                title: '提示框',				
					icon:0,								
	          }); 
			    num++;
	            return false;            
	          }
	          if(!reg.test($(this).val()))
	          {
				   layer.alert(str+=""+$(this).attr("name")+"只能为数字！\r\n",{
	                title: '提示框',				
					icon:0,								
	          });
			   num++;
	            return false; 
	          }
			 });
			  if(num>0){  return false;}	 	
	          else{
	        	  var usermoney=parseInt($("#userMoney").val())+parseInt($("#money").val());
	        	  //充值金额
	        	  $.ajax({
	  		        cache:true,
	  		        type: "POST",
	  		        url:'/users/updUserInfo?usermoney='+usermoney,
	  		        data:"",// 你的formid
	  		        async: false,
	  		        dataType:"json",
	  		        error: function(request) {
	  		            alert("Connection error");
	  		        },
	  		        success:function(data) {
	  		        	if(data){
	  		        		layer.alert('充值成功！',{
	  			               title: '提示框',				
	  						icon:1,		
	  						  });
	  						   layer.close(index);
	  		        		setTimeout(function(){//两秒后跳转  
	  		                   location.reload();
	  		                },1000);
	  		        	}else{
	  		        		layer.msg('充值失败！',{icon:2,time:1500});
	  		        	}
	  		        }
	  		    });
			  }		  		     				
			}
	    });
	});
	</script>
	<jsp:include page="common/footer.jsp"></jsp:include>
	<jsp:include page="common/right.jsp"></jsp:include>
</body>

</html>